<?php

$page_number = isset($_GET['page_number']) ? (int) $_GET['page_number'] : 1;


/**
 * The main template file.
 *
 * @package WordPress
 * @subpackage urbanmeandering
 */

get_header(); ?>

	
	<div id="main" class="group">
		<section id="recent-posts" class="content posts-list-overview">
			<h1 class="page-label"><span class="label">Latest</span><span class="right">&nbsp;</span></h1>
			<div>
        <?php 
         $page = $page_number;
         global $query_posts;
        //$page = get_query_var('page');
       if ( $page == 0 )
       {
           $page = 1;
       }
         
         $args =  array( 'post_type' => array('post','food','travel-activity','entertainment','advocacy-charity'),
                                                    'paged' => $page,
                                                    'post_status' => 'publish',
                                                    'ignore_sticky_posts' => 1); 
          query_posts($args);
           //print_r($wp_query);
//           $args =  array( 'post_type' => array('post','food','travel-activity','entertainment','advocacy-charity'),
//                                                    'paged' => $page,
//                                                    'post_status' => 'publish',
//                                                    'ignore_sticky_posts' => 1,
//                                                    'posts_per_page' => 6); 
         //  $the_query = new WP_Query($args);
          
        ?>
				<?php if ( have_posts() ) :  ?>
        <?php  while ( have_posts() ) : 
                    the_post();
        ?>
        <article>
            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium'); ?></a>
					<div class="text">
						<a href="<?php the_permalink(); ?>"><h2 class="entry-title"><?php the_title(); ?></h2></a>
            <p class="entry-desc"><time datetime="2012-08-08"><?php the_time(get_option('date_format')); ?></time> - <?php the_excerpt(); ?></p>
            
					</div>
             <?php 
            $args = array('count' => true ,'status' => 'approve' ,'post_id' => get_the_ID());
            $comments = get_comments($args);
          
        ?>
            <div class="comment_block"> 
                <span class="comment_count"><a href=" <?php comments_link();  ?>">
                    <?php echo $comments; echo ( $comments > 1) ? ' Comments' : ' Comment'; ?> 
                    </a>
                </span>
            </div>
				</article>
      
        <?php       endwhile; ?>
        <?php  //wp_reset_query(); ?>
        <?php endif; ?>
	
			</div>
			<?php page_navigation(); ?>	
		</section>
		
    <?php get_sidebar(); ?>
		
		
	</div>
	
<?php get_footer(); ?>